import React from 'react';
import { Link } from 'react-router-dom';
import { Map, Languages, Download, Settings, Compass } from 'lucide-react';
import '../globals.css';

const HomeNew: React.FC = () => {
  const features = [
    {
      name: '智能地图',
      description: '探索周边景点，规划最佳路线',
      icon: Map,
      href: '/map',
      color: 'bg-blue-500'
    },
    {
      name: '实时翻译',
      description: '支持多种语言的文字和语音翻译',
      icon: Languages,
      href: '/translation',
      color: 'bg-green-500'
    },
    {
      name: '离线内容',
      description: '下载离线地图和翻译包',
      icon: Download,
      href: '/offline-content',
      color: 'bg-purple-500'
    },
    {
      name: '个性设置',
      description: '自定义您的旅行偏好',
      icon: Settings,
      href: '/settings',
      color: 'bg-orange-500'
    }
  ];

  return (
    <div className="min-h-screen bg-gradient-to-br from-blue-50 to-indigo-100">
      <div className="container mx-auto px-4 py-8">
        {/* 欢迎区域 */}
        <div className="text-center mb-12">
          <h1 className="text-3xl md:text-4xl font-bold text-gray-900 mb-4">
            欢迎使用多语言旅行助手
          </h1>
          <p className="text-lg text-gray-600 max-w-2xl mx-auto">
            您的智能旅行伙伴，提供实时翻译、智能导航、离线地图等功能，
            让您的旅行更加轻松愉快。
          </p>
        </div>

        {/* 功能卡片 */}
        <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12">
          {features.map((feature) => {
            const Icon = feature.icon;
            return (
              <Link
                key={feature.name}
                to={feature.href}
                className="bg-white rounded-xl shadow-lg hover:shadow-xl transition-all duration-300 p-6 group"
              >
                <div className={`${feature.color} w-14 h-14 rounded-xl flex items-center justify-center mb-4 group-hover:scale-110 transition-transform duration-300 shadow-lg`}>
                  <Icon className="h-7 w-7 text-white" />
                </div>
                <h3 className="text-xl font-bold text-gray-900 mb-2">
                  {feature.name}
                </h3>
                <p className="text-gray-600">
                  {feature.description}
                </p>
              </Link>
            );
          })}
        </div>

        {/* 快速开始 */}
        <div className="text-center max-w-3xl mx-auto">
          <h2 className="text-2xl font-bold text-gray-900 mb-6">
            快速开始您的旅行
          </h2>
          <div className="flex flex-col sm:flex-row gap-4 justify-center">
            <Link
              to="/map"
              className="bg-blue-600 text-white px-8 py-3 rounded-xl font-semibold hover:bg-blue-700 transition-all duration-300"
            >
              🗺️ 探索地图
            </Link>
            <Link
              to="/translation"
              className="bg-white text-blue-600 border-2 border-blue-600 px-8 py-3 rounded-xl font-semibold hover:bg-blue-50 transition-all duration-300"
            >
              🌐 开始翻译
            </Link>
          </div>
        </div>
      </div>
    </div>
  );
};

export default HomeNew;